package demo.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import demo.dao.UserMapper;
import demo.model.User;

@Service("loginService")
public class LoginServiceImpl implements LoginService
{

	private UserMapper userMapper;

	@Autowired
	public void setUserMapper(UserMapper userMapper)
	{
		this.userMapper = userMapper;
	}

	@Override
	public User getUser(Integer id) {
		
		return userMapper.getUserById(id);
	}

	@Override
	public void addUser(User user) {
		userMapper.addUser(user);
		
	}

	@Override
	public User getUserByName(String userName) {
		return userMapper.getUserByName(userName);
	}

	@Override
	public User login(String userName, String password) {
		// TODO Auto-generated method stub
		return null;
	}
}
